<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /

    # Allow direct access to assets in public folder
    RewriteCond %{REQUEST_URI} ^/public/
    RewriteRule ^public/(.*)$ public/$1 [L]

    # Redirect all other requests to public folder
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# التأكد من عرض أخطاء PHP (يمكن إزالة هذا في بيئة الإنتاج)
<IfModule mod_php7.c>
    php_flag display_errors Off
    php_value error_reporting E_ALL
</IfModule>
